/*
 * @Author: szx
 * @Date: 2022-02-20 12:14:12
 * @LastEditTime: 2022-02-20 12:22:00
 * @Description:
 * @FilePath: \leetcode\700-799\717\717.js
 */
/**
 * @param {number[]} bits
 * @return {boolean}
 */
var isOneBitCharacter = function (bits) {
    let i = 0;
    let last = 1;
    while (i < bits.length) {
        if (bits[i] === 1) {
            i += 2;
            last = 2;
        } else {
            i += 1;
            last = 1;
        }
    }
    return last === 1 ? true : false;
};
